////////////////////////////////////////////////////////////
/* StripperNPC Script Original written by Scarface//Odin //
 *                                                      //
 * This script can be easily edited to be              //
 * used for your server. Throughout the script        //
 * are comments on what each thing does so that      //
 * you can edit this. You can create custom         //
 * teleporting locations and menus.                //
 *                                                //
 * Originally written for use with Moon++        //
 */                                             //
/////////////////////////////////////////////////


#include "StdAfx.h"
#include "Setup.h"

class SCRIPT_DECL StripperNPC : public GossipScript
{
public:
	void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
	void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
	void GossipEnd(Object * pObject, Player* Plr);
	void Destroy()
	{
	delete this;
	}
};

void StripperNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
	GossipMenu *Menu;
	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
	Menu->AddItem(0, "50g: Give me a Kiss...", 1);
	Menu->AddItem(0, "500g: Dance for me...", 2);
	Menu->AddItem(0, "???g: Show your ass...", 3);
	Menu->SendTo(Plr);
}

void StripperNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
	Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
	if(pObject==NULL)
		return;

	switch(IntId)
	{
	case 0: // Return to start

		GossipHello(pCreature, Plr, true);
		break;

	case 1: // Kiss
		{
			uint32 price = 500000;
			uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
			if (currentgold>=price)
			{
				int32 newgold = currentgold - price;
				Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "*Kiss*, you want more?");
				pCreature->Emote(EMOTE_ONESHOT_KISS);
				Plr->Gossip_Complete();
			} 
			else 
			{
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "A kiss from me is atleast 50g, i don't come cheap!");
				pCreature->Emote(EMOTE_ONESHOT_POINT);
				Plr->Gossip_Complete();
			}
		}
		break;
	
	case 2: // Dance
		{
			uint32 price = 5000000;
			uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
			if (currentgold>=price)
			{
				int32 newgold = currentgold - price;
				Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "*Dance*, Partay!");
				pCreature->Emote(EMOTE_STATE_DANCE);
				Plr->Gossip_Complete();
			} 
			else 
			{
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Sorry darling, i need 500g to dance for you.");
				pCreature->Emote(EMOTE_ONESHOT_POINT);
				Plr->Gossip_Complete();
			}
		}
		break;

	case 3: // Strip
		{
			uint32 price = 5000000;
			uint32 currentgold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
			if (currentgold>=price)
			{
				int32 newgold = currentgold - price;
				Plr->SetUInt32Value(PLAYER_FIELD_COINAGE,newgold);
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Disgusting! I'm not that kind of woman! Give me 500g or i'll call security!");
				pCreature->Emote(EMOTE_ONESHOT_RUDE);
				Plr->Gossip_Complete();
			} 
			else 
			{
				pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "So what did you want me to do? Kiss or Dance, because you haven't got the money");
				pCreature->Emote(EMOTE_ONESHOT_POINT);
				Plr->Gossip_Complete();
			}
		}
		break;
	}
};

void StripperNPC::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}

void SetupStripperNPC(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new StripperNPC();
mgr->register_gossip_script(55554, gs);
}